package org.fujay.langchain4jserver.domain.model.exception;

import org.fujay.langchain4jserver.domain.model.vo.ModelId;

/**
 * 当尝试访问或操作不存在的模型时抛出此异常。
 */
public class ModelNotFoundException extends RuntimeException {

    private static final String MESSAGE_TEMPLATE = "未找到 ID 为 [%s] 的模型。";

    public ModelNotFoundException(ModelId modelId) {
        super(String.format(MESSAGE_TEMPLATE, modelId != null ? modelId.value() : "<null>"));
    }

    public ModelNotFoundException(ModelId modelId, Throwable cause) {
        super(String.format(MESSAGE_TEMPLATE, modelId != null ? modelId.value() : "<null>"), cause);
    }
}
